Next | Prev | Up | Top | Contents | Index

Commands to Control Execution Flow

The commands summarized in Table 11-2 are used to stop, start, and single-step execution in the kernel.

Commands to Control Execution
CommandExampleOperation
brkbrkList all breakpoints currently set.
brk addr brk dk_readSet a breakpoint at the specified addr.
ccRestart execution at the point of interruption in the current CPU.
c cpuid [cpuid]...
c all
c 0Restart execution in the specified CPU, or in all stopped CPUs. Available in multiprocessors only.
call addr [args] call geteminor 0Call a kernel function and report the contents of the result register on return.
cpu cpu Displays the cpu ID of the currently-executing CPU. Available in multiprocessors only.
cpu cpuid cpu 0Force symmon execution to the specified CPU. That CPU must be executing symmon. Other CPUs executing symmon wait. Available in multiprocessors only.
goto addr goto geteminor Set a temporary breakpoint at addr and then continue execution as for the c command (in effect "go until addr is reached").
quitquit Return to the boot PROM, forcing an instant reboot.
s [count]s 8 Single-step through 1 or count instructions, displaying each instruction and the register contents it uses. A branch and the instruction in "delay slot" following it count as 1. Steps into subroutines.
S [count]S 8 Single-step through 1 or count instructions as for the s command, but do not step into subroutines.
unbrk nunbrk 2Remove break point number n. Use brk with no argument to list break points by number.
wpt {r|w|rw} physaddr wpt r 0x0841f608 Set a hardware watchpoint on a physical address.

Tip: One way to force a memory dump from symmon is the command call dumpsys. Following a break or a watchpoint, use the bt command to display the stack history and use printreg to display the registers (see "Commands to Display Memory").

The hardware watchpoint used by the wpt command uses hardware registers in the MIPS R4000 and R10000 processors (the R8000 does not support the watchpoint registers). When a read or write access is addressed to any byte in the doubleword specified by the physical address, symmon gains control and displays the instruction that is attempting the access on the console terminal.

The argument of wpt must be a physical memory address and a multiple of 8. Use tlbvtop to get the physical equivalent of an address in a user address space (see "Commands to Manage Virtual Memory"). In a 32-bit kernel, the physical equivalent of an address in kernel space is obtained by changing the most significant hex digit to 0.


Next | Prev | Up | Top | Contents | Index